package cn.com.blueInfo.bpm.system.enums;

import cn.com.blueInfo.bpm.common.enums.BaseEnum;
import com.baomidou.mybatisplus.annotation.EnumValue;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;
import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 表单类型
 * @author suxch
 * @since 2025/8/28 22:15
 */
@Getter
@AllArgsConstructor
public enum DynamicFormType implements BaseEnum<Integer> {

    /** 表单类型-系统内置 */
    SYSTEM_BUILT_IN(1, "系统内置"),
    /** 表单类型-自定义表单 */
    CUSTOM_FORM(2, "自定义表单"),
    /** 表单类型-流程类表单 */
    PROCESS_FORM(3, "流程类表单"),
    /** 表单类型-记录类表单 */
    RECORD_FORM(4, "记录类表单"),
    /** 表单类型-查询类表单 */
    QUERY_FORM(5, "查询类表单"),
    /** 表单类型-配置类表单 */
    CONFIG_FORM(6, "配置类表单"),
    /** 表单类型-交互类表单 */
    INTERACTIVE_FORM(7, "交互类表单");;

    @EnumValue
    private final Integer code;

    @JsonValue
    private final String desc;

    public static DynamicFormType getByCode(Integer code) {
        return BaseEnum.getByCode(DynamicFormType.class, code);
    }

    @JsonCreator
    public static DynamicFormType getByName(String name) {
        return BaseEnum.getByName(name, DynamicFormType.class);
    }

}
